import 'package:fate_blind_box/chat_view/ahu_text.dart';
import 'package:fate_blind_box/config/app_style.dart';
import 'package:fate_blind_box/routes/page_route_names.dart';
import 'package:fate_blind_box/widget/meet_appbar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'logic.dart';

class SetFriendPage extends GetView<SetFriendLogic> {
  const SetFriendPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MeetAppBar(
        title: '聊天设置',
        backgroundColor: '#EDEDED'.stringToColor,
      ),
      backgroundColor: '#EDEDED'.stringToColor,
      body: Column(
        children: [
          SizedBox(height: 17.w),
          Container(
            padding: EdgeInsets.symmetric(horizontal: 15.w),
            height: 56.w,
            color: Colors.white,
            child: Row(
              children: [
                Expanded(
                    child: AhuText(
                      text: '设置备注',
                      fontSize: 16,
                      fontWeight: FontWeight.w400,
                      color: '#141414'.stringToColor,
                    )),
                InkWell(
                  onTap: ()=> Get.toNamed(PageRouteNames.friendSetRemake),
                  child: Image.asset(
                    'images/right.png',
                    width: 12.w,
                    height: 24.w,
                  ),
                ),
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 1.w),
            padding: EdgeInsets.symmetric(horizontal: 15.w),
            height: 56.w,
            color: Colors.white,
            child: Row(
              children: [
                Expanded(
                    child: AhuText(
                      text: '消息免打扰',
                      fontSize: 16,
                      fontWeight: FontWeight.w400,
                      color: '#141414'.stringToColor,
                    )),
                GetX<SetFriendLogic>(
                  init: SetFriendLogic(),
                  initState: (_) {},
                  builder: (logic) {
                    return CupertinoSwitch(
                      value: logic.state.exempt.value,
                      onChanged: (value) {
                        logic.state.exempt.value  = !logic.state.exempt.value;
                      },
                      activeColor: '#614AC0'.stringToColor,
                    );
                  },
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
